package com.gulimall.search.config;


/**
 * @Description: 自定义阻塞返回方法
 * @Created: with IntelliJ IDEA.
 * @createTime: 2020-07-13 11:30
 **/

//@Configuration
public class GulimallSearchSentinelConfig {
//    public GulimallSearchSentinelConfig() {
//
//        WebCallbackManager.setUrlBlockHandler(new UrlBlockHandler() {
//            @Override
//            public void blocked(HttpServletRequest request, HttpServletResponse response, BlockException ex) throws IOException {
//                R error = R.error(BizCondeEnume.TO_MANY_REQUEST.getCode(), BizCondeEnume.TO_MANY_REQUEST.getMsg());
//                response.setCharacterEncoding("UTF-8");
//                response.setContentType("application/json");
//                response.getWriter().write(JSON.toJSONString(error));
//            }
//        });

//    }

}
